from flask import blueprints, render_template, session
from mainapp.dao.user_dao import UserDao

blue = blueprints('bank',__name__)

@blue.route('/list2')
def listfordb():
    if not session.get('menus'):
        session['menus'] = [
            {'title':'用户管理', 'url':'/user/模板作业list02'},
            {'title': '银行管理', 'url': '/bank/list02'},
            {'title': '银行卡管理', 'url': '/card/模板作业list02'}
        ]

    dao = UserDao()
    data = {
        'users': dao.list(),
        'session' : session
    }

    return render_template('user/模板作业list02.html',**data)